﻿using DJY.Code;
using DJY.Domain.Entity.SystemManage;
using DJY.Domain.ViewModel;
using System;
using System.Collections.Generic;
using System.Data.Entity;

namespace DJY.Service.SystemSecurity
{
    /// <summary>
    /// 系统服务
    /// </summary>
    public interface ISysService:IDependency
    {
        /// <summary>
        /// 获取流水序列号
        /// </summary>
        /// <param name="key">值</param>
        /// <param name="timeFlag">时间格式</param>
        /// <param name="start">起始值，比如10000</param>
        /// <param name="length">序号长度，默认6，不足左侧补0</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">key,timeFlag不能为空</exception>
        string GetNextSerialNo(string key, string timeFlag,
            int start = 0, int length = 6);

        /// <summary>
        /// 获取用户指定模块按钮组
        /// </summary>
        /// <param name="userId">登陆用户</param>
        /// <param name="moduleName">模块名称</param>
        /// <returns></returns>
        List<string> GetUserModuleButtons(string userId, string moduleName);

        /// <summary>
        /// 获取系统模块
        /// </summary>
        /// <param name="orgId">单位ID</param>
        /// <returns></returns>
        List<SysModuleEntity> GetSysModules(string orgId);

        /// <summary>
        /// 获取系统模块
        /// </summary>
        /// <param name="db">数据库实例</param>
        /// <param name="orgId">单位ID</param>
        /// <returns></returns>
        List<SysModuleEntity> GetSysModules(DbContext db, string orgId);

        /// <summary>
        /// 获取用户岗位
        /// </summary>
        /// <param name="userId">登陆用户</param>
        /// <returns></returns>
        Tuple<string, string, string> GetUserDuty(string userId);

        /// <summary>
        /// 获取系统字典
        /// </summary>
        /// <param name="codes"></param>
        /// <returns></returns>
        List<SysItem> GetSysItems(List<string> codes);

        /// <summary>
        /// 获取系统字典
        /// </summary>
        /// <param name="cateCode">分类编码</param>
        /// <param name="code">字典编码</param>
        /// <returns></returns>
        SysItemCode GetSysItemCode(string cateCode, string code);


    }
}
